var accounts = [[2,8,7],[7,1,3],[1,9,5]];

var maximumWealth = function(accounts) {
    var sum = 0,max = 0;
    accounts.forEach(e => {
        sum = 0
        e.forEach(item => {
            sum+=item;
        })
        if(sum>max) {
            max = sum
        }
    });
    return max
}

console.log(maximumWealth(accounts))